﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="DepartmentList.aspx.cs" Inherits="AB.ServiceDirectory.Design.DepartmentsMaintenance.DepartmentList" %>

<%@ Import Namespace="AB.ServiceDirectory.Commons" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentTitle" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="server">
    <asp:UpdatePanel runat="server" ID="UpdatePanelDepartmentList">
        <ContentTemplate>
            <div class="titleh">
                <h3 class="sorting_range">
                    <asp:LinkButton ID="LinkButtonAll" runat="server" OnCommand="FilterByLetters_Command"
                        CommandName="all">All</asp:LinkButton>
                    <asp:LinkButton ID="LinkButton09" runat="server" CommandName="09" OnCommand="FilterByLetters_Command">0-9</asp:LinkButton>
                    <asp:LinkButton ID="LinkButtonAE" runat="server" CommandName="ae" OnCommand="FilterByLetters_Command">A B C D E</asp:LinkButton>
                    <asp:LinkButton ID="LinkButtonFJ" runat="server" CommandName="fj" OnCommand="FilterByLetters_Command">F G H I J</asp:LinkButton>
                    <asp:LinkButton ID="LinkButtonKN" runat="server" CommandName="kn" OnCommand="FilterByLetters_Command">K L M N </asp:LinkButton>
                    <asp:LinkButton ID="LinkButtonOR" runat="server" CommandName="or" OnCommand="FilterByLetters_Command">O P Q R</asp:LinkButton>
                    <asp:LinkButton ID="LinkButtonSV" runat="server" CommandName="sv" OnCommand="FilterByLetters_Command">S T U V</asp:LinkButton>
                    <asp:LinkButton ID="LinkButtonWZ" CssClass="last" runat="server" CommandName="wz"
                        OnCommand="FilterByLetters_Command">W X Y Z</asp:LinkButton>
                    <span class="right">
                        <asp:LinkButton ID="LinkButtonCreate" runat="server" CssClass="hg-blue" 
                            onclick="LinkButtonCreate_Click">Create</asp:LinkButton>
                        <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                            OnCheckedChanged="CheckBoxInactive_CheckedChanged" />
                    </span>
                </h3>
            </div>
        
        <asp:GridView ID="GridViewDepartmentList" runat="server" CssClass="tablesorter" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSourceDepartmentList" AllowPaging="True" PageSize="15"
            AllowSorting="True">
            <columns>
                    <asp:BoundField HeaderText="Department Name" DataField="DepartmentName" SortExpression="DepartmentName">
                        <HeaderStyle HorizontalAlign="Left" CssClass="header"/>
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Address Line 1" SortExpression="AddressLine">
                        <ItemTemplate>
                            <%#Eval("Address.AddressLine") %>
                        </ItemTemplate>
                         <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Postcode" SortExpression="Postcode">
                        <ItemTemplate>
                            <%#Eval("Address.Postcode") %>
                        </ItemTemplate>
                         <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Contact" SortExpression="Surname">
                        <ItemTemplate>
                            <%#Eval("Contact.Surname") %>>
                        </ItemTemplate>
                         <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Is Active?" SortExpression="IsActive">
                        <ItemTemplate>
                            <%#Eval("IsActive") %>
                        </ItemTemplate>
                         <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                    </asp:TemplateField>
            </columns>
        </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div class="grid740 simplebox">
        <asp:ObjectDataSource ID="ObjectDataSourceDepartmentList" runat="server" TypeName="AB.ServiceDirectory.BO.DepartmentBO"
            SelectMethod="GetDepartment" OnSelecting="ObjectDataSourceDepartmentList_Selecting"
            EnablePaging="True" SelectCountMethod="GetDepartmentCount" StartRowIndexParameterName="startRowIndex"
            MaximumRowsParameterName="maxRows" SortParameterName="sortType">
            <SelectParameters>
                <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="False"  />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
</asp:Content>
